%% US Public Debt and Safe Asset Market Power
%% Jason Choi, Rishabh Kirpalani, and Diego Perez
%% Sept 1, 2023

%% Calibrate Monopoly Equilibrium w/ Alternate Benefit Function

% clear all;
close all;

%% 1935-2020
P.gamma = 2;
P.lambda = 1;
P.rspread = 0.0062;
P.rus = 0.0053;
P.busus = 0.41;
P.eta = 0.997;
P.N = 1;

P.beta = 1/(P.rspread+(1+P.rus));
P.lambda_f = (P.rspread+P.eta-1)/P.busus;
P.eta_f = (-P.rspread+(P.eta-1)*log(0.41)+P.eta-1)/(P.eta-1);

P.alpha = 0.3;
P.delta = 0.1;
P.delta_rw = P.delta;
P.delta_us = P.delta;

P.gdp_ratio = 1.1;
P.NFA_us = -0.05;
P.home_bias = 0.8;

[param_out err]=fsolve(@(x) func_moments_altbenefit(x,P),[0.7,0.9,1,1]);
P.sigma = param_out(1);
P.sigma_star = param_out(2);
P.A = param_out(3);
P.Astar = param_out(4);

save 'calibration_altbenefit'

